/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package edu.cmu.cs.webapp.ioms.models.impl;

import edu.cmu.cs.webapp.ioms.models.IOMSPackage;
import edu.cmu.cs.webapp.ioms.models.LogEntry;

import java.util.Date;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Log Entry</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.LogEntryImpl#getLog_id <em>Log id</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.LogEntryImpl#getLog_msg <em>Log msg</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.LogEntryImpl#getLog_type <em>Log type</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.LogEntryImpl#getUser <em>User</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.LogEntryImpl#getTime <em>Time</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class LogEntryImpl extends EObjectImpl implements LogEntry {
	/**
	 * The default value of the '{@link #getLog_id() <em>Log id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLog_id()
	 * @generated
	 * @ordered
	 */
	protected static final int LOG_ID_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getLog_id() <em>Log id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLog_id()
	 * @generated
	 * @ordered
	 */
	protected int log_id = LOG_ID_EDEFAULT;

	/**
	 * The default value of the '{@link #getLog_msg() <em>Log msg</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLog_msg()
	 * @generated
	 * @ordered
	 */
	protected static final String LOG_MSG_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLog_msg() <em>Log msg</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLog_msg()
	 * @generated
	 * @ordered
	 */
	protected String log_msg = LOG_MSG_EDEFAULT;

	/**
	 * The default value of the '{@link #getLog_type() <em>Log type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLog_type()
	 * @generated
	 * @ordered
	 */
	protected static final String LOG_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLog_type() <em>Log type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLog_type()
	 * @generated
	 * @ordered
	 */
	protected String log_type = LOG_TYPE_EDEFAULT;

	/**
	 * The default value of the '{@link #getUser() <em>User</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUser()
	 * @generated
	 * @ordered
	 */
	protected static final String USER_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getUser() <em>User</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUser()
	 * @generated
	 * @ordered
	 */
	protected String user = USER_EDEFAULT;

	/**
	 * The default value of the '{@link #getTime() <em>Time</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTime()
	 * @generated
	 * @ordered
	 */
	protected static final Date TIME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTime() <em>Time</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTime()
	 * @generated
	 * @ordered
	 */
	protected Date time = TIME_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LogEntryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return IOMSPackage.Literals.LOG_ENTRY;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getLog_id() {
		return log_id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLog_id(int newLog_id) {
		int oldLog_id = log_id;
		log_id = newLog_id;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.LOG_ENTRY__LOG_ID, oldLog_id, log_id));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLog_msg() {
		return log_msg;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLog_msg(String newLog_msg) {
		String oldLog_msg = log_msg;
		log_msg = newLog_msg;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.LOG_ENTRY__LOG_MSG, oldLog_msg, log_msg));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLog_type() {
		return log_type;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLog_type(String newLog_type) {
		String oldLog_type = log_type;
		log_type = newLog_type;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.LOG_ENTRY__LOG_TYPE, oldLog_type, log_type));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getUser() {
		return user;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setUser(String newUser) {
		String oldUser = user;
		user = newUser;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.LOG_ENTRY__USER, oldUser, user));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Date getTime() {
		return time;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTime(Date newTime) {
		Date oldTime = time;
		time = newTime;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.LOG_ENTRY__TIME, oldTime, time));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case IOMSPackage.LOG_ENTRY__LOG_ID:
				return getLog_id();
			case IOMSPackage.LOG_ENTRY__LOG_MSG:
				return getLog_msg();
			case IOMSPackage.LOG_ENTRY__LOG_TYPE:
				return getLog_type();
			case IOMSPackage.LOG_ENTRY__USER:
				return getUser();
			case IOMSPackage.LOG_ENTRY__TIME:
				return getTime();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case IOMSPackage.LOG_ENTRY__LOG_ID:
				setLog_id((Integer)newValue);
				return;
			case IOMSPackage.LOG_ENTRY__LOG_MSG:
				setLog_msg((String)newValue);
				return;
			case IOMSPackage.LOG_ENTRY__LOG_TYPE:
				setLog_type((String)newValue);
				return;
			case IOMSPackage.LOG_ENTRY__USER:
				setUser((String)newValue);
				return;
			case IOMSPackage.LOG_ENTRY__TIME:
				setTime((Date)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case IOMSPackage.LOG_ENTRY__LOG_ID:
				setLog_id(LOG_ID_EDEFAULT);
				return;
			case IOMSPackage.LOG_ENTRY__LOG_MSG:
				setLog_msg(LOG_MSG_EDEFAULT);
				return;
			case IOMSPackage.LOG_ENTRY__LOG_TYPE:
				setLog_type(LOG_TYPE_EDEFAULT);
				return;
			case IOMSPackage.LOG_ENTRY__USER:
				setUser(USER_EDEFAULT);
				return;
			case IOMSPackage.LOG_ENTRY__TIME:
				setTime(TIME_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case IOMSPackage.LOG_ENTRY__LOG_ID:
				return log_id != LOG_ID_EDEFAULT;
			case IOMSPackage.LOG_ENTRY__LOG_MSG:
				return LOG_MSG_EDEFAULT == null ? log_msg != null : !LOG_MSG_EDEFAULT.equals(log_msg);
			case IOMSPackage.LOG_ENTRY__LOG_TYPE:
				return LOG_TYPE_EDEFAULT == null ? log_type != null : !LOG_TYPE_EDEFAULT.equals(log_type);
			case IOMSPackage.LOG_ENTRY__USER:
				return USER_EDEFAULT == null ? user != null : !USER_EDEFAULT.equals(user);
			case IOMSPackage.LOG_ENTRY__TIME:
				return TIME_EDEFAULT == null ? time != null : !TIME_EDEFAULT.equals(time);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (log_id: ");
		result.append(log_id);
		result.append(", log_msg: ");
		result.append(log_msg);
		result.append(", log_type: ");
		result.append(log_type);
		result.append(", user: ");
		result.append(user);
		result.append(", time: ");
		result.append(time);
		result.append(')');
		return result.toString();
	}

} //LogEntryImpl
